package com.example.travelservlet.province.controller;

import com.example.travelservlet.entity.Province;
import com.example.travelservlet.province.service.ProvinceService;
import com.example.travelservlet.user.domain.Result;
import com.example.travelservlet.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/province")
public class ProvinceController {
    @Autowired
    private ProvinceService provinceService;

    @GetMapping("/findProvince")
    public Result<List<Province>> findProvince(){
        List<Province> provinces = provinceService.findProvince();
        return ResultUtil.success(provinces);
    }
}
